<?php 
	$checkQ = mysql_query("select * from dt_news_images where n_id = '".$_GET['id']."'");
	if (mysql_num_rows($checkQ)>0){
?>
<div id="galerie_corp">
<div id="galerie_overlay">
    <img src="../../templates/default/images/corner-galerie.png" width="25" height="25">
</div>
<div id="galerie_child_corp">

    <div id="galerie_corp">
    <div class="gallery_root_var">
    <?php
        $query = mysql_query("select * from dt_news where news_id = '".$_GET['id']."'");
        while ($qrow = mysql_fetch_array($query)){
            if ($qrow['type'] == 'image'){
                echo '<div>';
                echo '<div style="z-index: 2">';
                $qimg = mysql_query("select * from dt_news_images where n_id = '".$qrow['news_id']."'");
                $qimgrow = mysql_fetch_array($qimg);
                echo '<a class="lightbox" style="z-index:2; position: absolute; width: 620px; height: 285px;overflow:hidden" href="../../uploads/news_img/thumbs/thumb_620-'.$qimgrow['image_file'].'">';
                echo '<img src="../../uploads/news_img/thumbs/thumb_620-'.$qimgrow['image_file'].'" width="620" height="285">';
                echo '</a>';
                echo '</div>';
                $q2 = mysql_query("select * from dt_news where news_id = '".$qrow['news_id']."'");
                while ($q2row = mysql_fetch_array($q2)){
                    echo'<a href="'.$q2row['link'].'">';
                    echo '<div class="gallery_picture_text_ctg">'.$q2row['news_title'].'</div>';
                    echo'</a>';
                }
                echo '</div>';
            }
            elseif ($qrow['type'] == 'gallery'){
                echo '<div class="gallery_root_var">';
                echo '<div class="gallery_picture_holder_var">';
                //<!-- imaginile mari -->
                echo '<div id="pozaMare" style="overflow:hidden; height:285px; width:620px;float:left;">';

                $j=0;
                $images = mysql_query("select * from dt_news_images where n_id = '".$qrow['news_id']."'");
                while ($iRow = mysql_fetch_array($images)){
                    echo '<div id="poza'.$j.'">';
                    echo '<img src="../../uploads/news_img/thumbs/thumb_620-'.$iRow['image_file'].'" width="620">';
                    echo '</div>';
                    $j++;
                }
                echo '</div>';
                //<!-- end imaginile mari -->
                echo '</div>';
                echo '<div class="gallery_picture_text_var">';
                //<!-- text imagini -->
                $images = mysql_query("select * from dt_news where news_id = '".$qrow['news_id']."'");
                $iRowT = mysql_fetch_array($images);

                echo trimthem($iRowT['news_title']);
                //<!-- end text imagini -->
                echo '</div>';
                echo '<div class="gallery_slider_holder_var">';
                //<!-- thumbs slider -->
                echo '<div id="thumb" style="float:right;">';
                echo '<ul id="scroller">';

                $j=0;
                $images = mysql_query("select * from dt_news_images where n_id = '".$qrow['news_id']."'");
                while ($iRow = mysql_fetch_array($images)){
                    echo '<li id="clickPoza'.$j.'"><div class="thumbsize" style="background:url(../../uploads/news_img/thumbs/thumb_95-'.$iRow['image_file'].');"><img src="../../templates/default/images/chenar-alb-60x60.png" width="60" height="60"></div></li>';
                    $j++;
                }
                echo '</ul>';
                echo '</div>';
                //<!-- end thumbs slider -->
                echo '</div>';
                echo '</div>';
            }
            elseif ($qrow['type'] == 'playclick'){
                echo '<div id="wrapper">';
                echo '<div id="slider-wrapper" class="slider-wrapper">';
                echo '<div id="sliderVar" class="nivoSlider">';

                $images = mysql_query("select * from dt_news_images where n_id = '".$qrow['news_id']."'");
                while ($iRow = mysql_fetch_array($images)){
                    echo '<img src="../../uploads/news_img/thumbs/thumb_620-'.$iRow['image_file'].'" alt="" width="620" height="285" title="#htmlcaption" />';
                }
                echo '</div>';
                echo '<div id="butonplay"></div>';
                echo '<div id="htmlcaption" class="nivo-html-caption">';

                $images = mysql_query("select * from dt_news where news_id = '".$qrow['news_id']."'");
                $iRowT = mysql_fetch_array($images);
                echo trimthem($iRowT['news_title']);
                echo '</div>';
                echo '</div>';
                echo '</div>';
            }
        }
    ?>
    </div></div></div></div>
    <?php }?>